/******************************************************************************
 * * mmi_modem_adaptor_sms_file.h - data structure for mmi-modem adpator, sms file sub-module
 *
 * *(C) Copyright 2019 Asr International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef MMI_MODEM_ADAPTOR_SMS_FILE_H
#define MMI_MODEM_ADAPTOR_SMS_FILE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "ui_type.h"
#include "mmi_modemadp_interface.h"

#define MMI_MODEM_SMS_BOX_FILE   "C:/sms_box.db"

enum
{
    MMI_MODEM_SMS_INBOX,
    MMI_MODEM_SMS_SENDBOX
};
typedef uint8_t MMI_MODEM_SMS_BOX_TYPE;

//sms struct in file: MMI_Modem_Msg_Content_Info_t + pdu
//pdu structure in file: PduLen+Number+Time+Pdu
typedef struct
{
#define MMI_MODEM_SMS_FILE_LEN_SIZE sizeof(uint16_t)
#define MMI_MODEM_SMS_FILE_NUMBER_MAX 20
#define MMI_MODEM_SMS_FILE_TIME_MAX 20
#define MMI_MODEM_SMS_FILE_TEXT_MAX 1680
#define MMI_MODEM_SMS_FILE_HEADER_TOTAL_SIZE (MMI_MODEM_SMS_FILE_LEN_SIZE + \
                                              MMI_MODEM_SMS_FILE_NUMBER_MAX + \
                                              MMI_MODEM_SMS_FILE_TIME_MAX)
#define MMI_MODEM_SMS_FILE_PDU_TOTAL_SIZE (MMI_MODEM_SMS_FILE_HEADER_TOTAL_SIZE + \
                                            MMI_MODEM_SMS_FILE_TEXT_MAX)
#define MMI_MODEM_SMS_FILE_ITEM_TOTAL_SIZE (MMI_MODEM_SMS_FILE_PDU_TOTAL_SIZE + \
                                            sizeof(MMI_Modem_Msg_Content_Info_t))
    uint16_t                     TextLen;
    uint8_t                      Number[MMI_MODEM_SMS_FILE_NUMBER_MAX];
    uint8_t                      Time[MMI_MODEM_SMS_FILE_TIME_MAX];
    uint8_t                      Text[4];
} MMI_Modem_Sms_Pdu_t;

typedef struct
{
    uint32_t Index_Cnt;
    lv_ll_t  Sms_List; //ll element is MMI_Modem_Msg_Content_Info_t
} MMI_Modem_Sms_Box_t;

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*SETTING_CALL_H*/
